From 80c51dbb8ccb855025f54f579d3fcdc0970a031f Mon Sep 17 00:00:00 2001 From: tsteven4 Date: Thu, 18 Sep 2014 17:57:39 +0000 Subject: [PATCH] more use of qPrintable instead of CSTR or CSTRc with fatal and printf. --- gpsbabel/garmin_txt.cc | 2 +- gpsbabel/gdb.cc | 4 ++-- gpsbabel/geo.cc | 4 ++-- gpsbabel/lowranceusr.cc | 2 +- gpsbabel/lowranceusr4.cc | 22 +++++++++++----------- gpsbabel/mapfactor.cc | 4 ++-- gpsbabel/navicache.cc | 4 ++-- gpsbabel/raymarine.cc | 2 +- gpsbabel/trackfilter.cc | 4 ++-- gpsbabel/unicsv.cc | 2 +- gpsbabel/xmlgeneric.cc | 6 +++--- gpsbabel/xol.cc | 4 ++-- 12 files changed, 30 insertions(+), 30 deletions(-) diff --git a/gpsbabel/garmin_txt.cc b/gpsbabel/garmin_txt.cc index 27548afd0..c88ed950e 100644 --- a/gpsbabel/garmin_txt.cc +++ b/gpsbabel/garmin_txt.cc @@ -354,7 +354,7 @@ print_position(const Waypoint* wpt) if (! valid) { gbfprintf(fout, "#####\n"); fatal(MYNAME ": %s (%s) is outside of convertable area \"%s\"!\n", - wpt->shortname.isEmpty() ? "Waypoint" : CSTR(wpt->shortname), + wpt->shortname.isEmpty() ? "Waypoint" : qPrintable(wpt->shortname), pretty_deg_format(wpt->latitude, wpt->longitude, 'd', NULL, 0), gt_get_mps_grid_longname(grid_index, MYNAME)); } diff --git a/gpsbabel/gdb.cc b/gpsbabel/gdb.cc index ba1621925..f2b065825 100644 --- a/gpsbabel/gdb.cc +++ b/gpsbabel/gdb.cc @@ -1319,10 +1319,10 @@ gdb_check_waypt(Waypoint* wpt) if ((wpt->latitude < -90) || (wpt->latitude > 90.0)) fatal("Invalid latitude %f in waypoint %s.\n", - lat_orig, !wpt->shortname.isEmpty() ? CSTRc(wpt->shortname) : ""); + lat_orig, !wpt->shortname.isEmpty() ? qPrintable(wpt->shortname) : ""); if ((wpt->longitude < -180) || (wpt->longitude > 180.0)) fatal("Invalid longitude %f in waypoint %s.\n", - lon_orig, !wpt->shortname.isEmpty() ? CSTRc(wpt->shortname) : ""); + lon_orig, !wpt->shortname.isEmpty() ? qPrintable(wpt->shortname) : ""); } /*-----------------------------------------------------------------------------*/ diff --git a/gpsbabel/geo.cc b/gpsbabel/geo.cc index dc57f5ad1..6d7a37135 100644 --- a/gpsbabel/geo.cc +++ b/gpsbabel/geo.cc @@ -114,8 +114,8 @@ geo_read(void) GeoReadLoc(); if (reader.hasError()) { fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n", - CSTR(reader.errorString()), - CSTR(file.fileName()), + qPrintable(reader.errorString()), + qPrintable(file.fileName()), (long) reader.lineNumber(), (long) reader.columnNumber()); } diff --git a/gpsbabel/lowranceusr.cc b/gpsbabel/lowranceusr.cc index b825460ac..42cd8640b 100644 --- a/gpsbabel/lowranceusr.cc +++ b/gpsbabel/lowranceusr.cc @@ -918,7 +918,7 @@ lowranceusr_route_hdr(const route_head* rte) if (global_opts.debug_level >= 1) printf(MYNAME " route_hdr: route name \"%s\" num_legs = %d\n", - CSTRc(rte->rte_name), num_legs); + qPrintable(rte->rte_name), num_legs); } diff --git a/gpsbabel/lowranceusr4.cc b/gpsbabel/lowranceusr4.cc index 2ca8b0536..a6b59837b 100644 --- a/gpsbabel/lowranceusr4.cc +++ b/gpsbabel/lowranceusr4.cc @@ -319,7 +319,7 @@ register_waypt(const Waypoint* ref) if (global_opts.debug_level >= 2) { printf(MYNAME " adding waypt %s (%s) to table at index %d\n", - CSTRc(wpt->shortname), CSTRc(wpt->description), waypt_table_ct); + qPrintable(wpt->shortname), qPrintable(wpt->description), waypt_table_ct); } waypt_table[waypt_table_ct] = (Waypoint*)wpt; @@ -461,7 +461,7 @@ lowranceusr4_parse_waypoints(void) if (global_opts.debug_level >= 1) { printf(MYNAME " parse_waypoints: name = %s, uid_unit = %u, " "uid_seq_low = %d, uid_seq_high = %d, lat = %f, lon = %f, depth = %f\n", - CSTRc(wpt_tmp->shortname), fsdata->uid_unit, + qPrintable(wpt_tmp->shortname), fsdata->uid_unit, fsdata->uid_seq_low, fsdata->uid_seq_high, wpt_tmp->latitude, wpt_tmp->longitude, wpt_tmp->depth); } @@ -557,7 +557,7 @@ lowranceusr4_parse_routes(void) if (global_opts.debug_level >= 1) { printf(MYNAME " parse_routes: route name=%s has %d waypoints\n", - CSTRc(rte_head->rte_name), num_legs); + qPrintable(rte_head->rte_name), num_legs); } for (j = 0; j < num_legs; ++j) { @@ -568,7 +568,7 @@ lowranceusr4_parse_routes(void) if (wpt_tmp) { if (global_opts.debug_level >= 2) { printf(MYNAME " parse_routes: added wpt %s to route %s\n", - CSTRc(wpt_tmp->shortname), CSTRc(rte_head->rte_name)); + qPrintable(wpt_tmp->shortname), qPrintable(rte_head->rte_name)); } route_add_wpt(rte_head, new Waypoint(*wpt_tmp)); } @@ -685,7 +685,7 @@ lowranceusr4_parse_trails(void) if (global_opts.debug_level >= 1) { printf(MYNAME " parse_trails: trail %d name=%s has %d trackpoints\n", - trk_num, CSTRc(trk_head->rte_name), num_trail_pts); + trk_num, qPrintable(trk_head->rte_name), num_trail_pts); } for (j = 0; j < num_trail_pts; ++j) { @@ -713,7 +713,7 @@ lowranceusr4_parse_trails(void) if (global_opts.debug_level >= 2) { printf(MYNAME " parse_routes: added trackpoint %f,%f to route %s\n", - wpt_tmp->latitude, wpt_tmp->longitude, CSTRc(trk_head->rte_name)); + wpt_tmp->latitude, wpt_tmp->longitude, qPrintable(trk_head->rte_name)); } } } @@ -854,7 +854,7 @@ lowranceusr4_write_waypoints(void) for (i = 0; i < waypt_table_ct; ++i) { if (global_opts.debug_level >= 2) { printf(MYNAME " writing out waypt %d (%s - %s)\n", - i, CSTRc(waypt_table[i]->shortname), CSTRc(waypt_table[i]->description)); + i, qPrintable(waypt_table[i]->shortname), qPrintable(waypt_table[i]->description)); } lowranceusr4_waypt_disp((const Waypoint*)waypt_table[i]); } @@ -865,7 +865,7 @@ lowranceusr4_write_route_hdr(const route_head* rte) { if (global_opts.debug_level >= 1) { printf(MYNAME " writing route #%d (%s) with %d waypts\n", - route_uid, CSTRc(rte->rte_name), rte->rte_waypt_ct); + route_uid, qPrintable(rte->rte_name), rte->rte_waypt_ct); } /* UID unit number */ @@ -895,10 +895,10 @@ lowranceusr4_write_wpt_uids(const Waypoint* wpt) if (global_opts.debug_level >= 2) { if (waypt_idx > waypt_table_ct) { printf(MYNAME " WARNING: failed finding waypoint %s in waypoint table\n", - CSTRc(wpt->shortname)); + qPrintable(wpt->shortname)); } else { printf(MYNAME " adding waypt %d (%s) to route\n", - waypt_idx, CSTRc(waypt_table[waypt_idx]->shortname)); + waypt_idx, qPrintable(waypt_table[waypt_idx]->shortname)); } } @@ -932,7 +932,7 @@ lowranceusr4_write_track_hdr(const route_head* trk) { if (global_opts.debug_level >= 1) { printf(MYNAME " writing track %d (%s) with %d trackpoints\n", - track_uid, CSTRc(trk->rte_name), trk->rte_waypt_ct); + track_uid, qPrintable(trk->rte_name), trk->rte_waypt_ct); } /* UID unit number */ diff --git a/gpsbabel/mapfactor.cc b/gpsbabel/mapfactor.cc index 3d0912c10..f0320ac92 100644 --- a/gpsbabel/mapfactor.cc +++ b/gpsbabel/mapfactor.cc @@ -85,8 +85,8 @@ mapfactor_read(void) MapfactorRead(); if (reader.hasError()) { fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n", - CSTR(reader.errorString()), - CSTR(file.fileName()), + qPrintable(reader.errorString()), + qPrintable(file.fileName()), (long) reader.lineNumber(), (long) reader.columnNumber()); } diff --git a/gpsbabel/navicache.cc b/gpsbabel/navicache.cc index 26008fdc3..db910daa7 100644 --- a/gpsbabel/navicache.cc +++ b/gpsbabel/navicache.cc @@ -195,8 +195,8 @@ nav_read(void) } if (reader.hasError()) { fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n", - CSTR(reader.errorString()), - CSTR(file.fileName()), + qPrintable(reader.errorString()), + qPrintable(file.fileName()), (long) reader.lineNumber(), (long) reader.columnNumber()); } diff --git a/gpsbabel/raymarine.cc b/gpsbabel/raymarine.cc index 24fd69dc0..eee63d622 100644 --- a/gpsbabel/raymarine.cc +++ b/gpsbabel/raymarine.cc @@ -261,7 +261,7 @@ raymarine_read(void) wpt = find_waypt_by_name(str); if (wpt == NULL) fatal(MYNAME ": No associated waypoint for route point %s (Route %s)!\n", - str, CSTRc(rte->rte_name)); + str, qPrintable(rte->rte_name)); route_add_wpt(rte, new Waypoint(*wpt)); } diff --git a/gpsbabel/trackfilter.cc b/gpsbabel/trackfilter.cc index d7e8b212e..b526ddf21 100644 --- a/gpsbabel/trackfilter.cc +++ b/gpsbabel/trackfilter.cc @@ -473,8 +473,8 @@ trackfilter_pack(void) prev = track_list[j]; if (prev.last_time >= track_list[i].first_time) { fatal(MYNAME "-pack: Tracks overlap in time! %s >= %s at %d\n", - CSTR(prev.last_time.toString()), - CSTR(track_list[i].first_time.toString()), i); + qPrintable(prev.last_time.toString()), + qPrintable(track_list[i].first_time.toString()), i); } } diff --git a/gpsbabel/unicsv.cc b/gpsbabel/unicsv.cc index 86116b4f4..fa0196168 100644 --- a/gpsbabel/unicsv.cc +++ b/gpsbabel/unicsv.cc @@ -1249,7 +1249,7 @@ unicsv_fatal_outside(const Waypoint* wpt) { gbfprintf(fout, "#####\n"); fatal(MYNAME ": %s (%s) is outside of convertable area of grid \"%s\"!\n", - wpt->shortname.isEmpty() ? "Waypoint" : CSTR(wpt->shortname), + wpt->shortname.isEmpty() ? "Waypoint" : qPrintable(wpt->shortname), pretty_deg_format(wpt->latitude, wpt->longitude, 'd', NULL, 0), gt_get_mps_grid_longname(unicsv_grid_idx, MYNAME)); } diff --git a/gpsbabel/xmlgeneric.cc b/gpsbabel/xmlgeneric.cc index 0e5232efa..7acaaafe2 100644 --- a/gpsbabel/xmlgeneric.cc +++ b/gpsbabel/xmlgeneric.cc @@ -184,8 +184,8 @@ void xml_read(void) xml_run_parser(reader, current_tag); if (reader.hasError()) { fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n", - CSTR(reader.errorString()), - CSTR(file.fileName()), + qPrintable(reader.errorString()), + qPrintable(file.fileName()), (long) reader.lineNumber(), (long) reader.columnNumber()); } @@ -218,7 +218,7 @@ void xml_readstring(const char* str) xml_run_parser(reader, current_tag); if (reader.hasError()) { fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n", - CSTR(reader.errorString()), + qPrintable(reader.errorString()), "unknown", (long) reader.lineNumber(), (long) reader.columnNumber()); diff --git a/gpsbabel/xol.cc b/gpsbabel/xol.cc index 3a6eee20b..719f0946c 100644 --- a/gpsbabel/xol.cc +++ b/gpsbabel/xol.cc @@ -60,7 +60,7 @@ xol_overlay(xg_string args, const QXmlStreamAttributes* attrv) if (attrv->hasAttribute("version")) { if (attrv->value("version") != "1.0") { fatal(MYNAME ": Unsupported version %s.\n", - attrv->value("version").toString().toUtf8().constData()); + qPrintable(attrv->value("version").toString())); } } } @@ -166,7 +166,7 @@ xol_fatal_outside(const Waypoint* wpt) { gbfprintf(fout, "#####\n"); fatal(MYNAME ": %s (%s) is outside of convertable area \"%s\"!\n", - wpt->shortname.isEmpty() ? "Waypoint" : CSTRc(wpt->shortname), + wpt->shortname.isEmpty() ? "Waypoint" : qPrintable(wpt->shortname), pretty_deg_format(wpt->latitude, wpt->longitude, 'd', NULL, 0), gt_get_mps_grid_longname(grid_swiss, MYNAME)); } -- 2.30.2